<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" id="html">
    <head>
        <title></title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <base href="<?= base_url(1); ?>" />
        <link type="text/css" href="css/main.css?v=<?= $config['version'] ?>" rel="stylesheet" />
        <script language='javascript'>
        
      //显示物品
    	function showshopname()
    	{
    		var kindid = $('#kindid').val();
    		var allObject = <?=json_encode($shopidName) ?>;	//所有物品
    		var hotlimitObject = <?=json_encode($hotlimitObject)?>;	//限时抢购物品
    		//var kindObject=<?=json_encode($$kindObject) ?>;	//物品分类
    		//alert( ' allobject = '+allObject);
    		var strOption = '';
    		if(kindid == 1013)	//限时抢购
    		{
    			for(var one in hotlimitObject)
	    	    {
	    	    	strOption += '<option value="'+one+'" >'+one+"-"+hotlimitObject[one]+'</option>';
	    	    }
    		}else	//所有物品
    		{
        		
	    		for(var one in allObject)
	    	    {
	    	    	strOption += '<option value="'+one+'" >'+one+"-"+allObject[one]+'</option>';
	    	    }
	    	    /*
	    	    for(var one in kindObject[kindid])
	    	    {
	    	    	strOption += '<option value="'+one+'" >'+kindObject[kindid][one]+'</option>';
	    	    }*/
    		}
    		//alert('material = '+material+" stroption "+strOption); 
    		$('#shopidName').html(strOption);
    	} 
    	
        </script>
    </head>
    <body>
        <?php include(VIEWPATH . 'common/main_header.php'); ?>
        <?php
        	//print_r($kindid); 
        	//print_r($shopidName);
        ?>
        <form action="" method="POST" id="rowForm">
            <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tablegrid tableedit">
                <tr>
                    <td><?= translate('C_SELECT_AREA_TEXT') ?>:</td>
                    <td><?= $area_host ?></td>
                </tr>
                <tr>
                    <td><?= translate('MALL_MALLCLASSIFITOON_KINDID') ?>:</td>
                    <td>
                    <select name="row[kindid]" id="kindid" onChange="showshopname()">
			      	  <option value="-1"><?= translate('PLASE_SELECT') ?></option>
			      	  <?php foreach ($kindid as $key => $value) {?>
			      	  <option value="<?=$key ?>"><?=$value ?></option>
			      	  <?php }?>
		      	    </select>
		      	    </td>
                </tr>
                <tr>
                    <td><?= translate('MALL_MALLCLASSIFITOON_SHOPID') ?>:</td>
                    <td>
                    <select name="row[shopid]" id="shopidName" >
                    		<option value="-1"><?= translate('PLASE_SELECT') ?></option>
				      	  <?php foreach ($shopidName as $key => $value) {?>
				      	  	<option value="<?=$key ?>"><?=$value ?></option>
				      	  <?php }?>
                   	 </select>
                    </td>
                </tr>
                <tr>
                    <td><?= translate('MALL_MALLCLASSIFITOON_POSITION') ?>:</td>
                    <td><input type="text" name="row[position]" id="position" size="25"/></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input type="submit" value="<?= translate('SUBMIT') ?>" id="submit" /> <input type="reset" value="<?= translate('RESET') ?>" id="reset" /></td>
                </tr>
            </table>
        </form>
        <script type="text/javascript">
            SG.init("core.form", function() {
                $.formValidator.initConfig({formid: "#rowForm", submitonce: true});
                $("#id").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#name").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#position").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerror: '<?= translate('C_ONLY_NUM') ?>'});
            });
        </script>
    </body>
</html>